package Job

import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD

object WithEndSalArea {
  def main(args: Array[String]): Unit = {
    val sc: SparkContext = new SparkContext("local[*]", "WithEndSalArea")
    val inputPath: String = "file/JobData/input"
    val outputPath: String = "file/JobData/output/WithEndSalArea"

    val InfoLine: RDD[String] = sc.textFile(inputPath).repartition(2)

    val res = InfoLine
      .filter(x => (x.contains("年终双薪") && x.contains("同安区")))
      .map(x => {
        (x.split(",")(2), x.split(",")(0))
      })


    res.take(7).foreach(println)
  }

}
